import { ApiCall } from "tsrpc";
import { ReqGetAnnouncement, ResGetAnnouncement } from "../../shared/protocols/masterServer/PtlGetAnnouncement";

/**
 * @en normally stored in database, and controlled by management system.
 * @zh 正式项目中，一般存放在数据库，并通过管理后台修改
*/
const announcementMap: { [key: string]: string } = {}

announcementMap['lobby'] = '这是一个多人联机对战大厅解决方案，拥有大厅+子游戏的前后端完整架构，合作加微信：qilinzi6666';
announcementMap['billiards'] = '这是一个多人联机对战大厅解决方案，联机台球已实现多端同步，合作加微信：qilinzi6666';
announcementMap['gomoku'] = '这是一个多人联机对战大厅解决方案，五子棋拥有联机对战和 AI 模式，合作加微信：qilinzi6666';

export async function ApiGetAnnouncement(call: ApiCall<ReqGetAnnouncement, ResGetAnnouncement>) {
    let content = announcementMap[call.req.type] || '';

    call.succ({ content: content });
}